package com.cn.web.controller.EM.wo_manage;

import com.alibaba.fastjson2.JSONObject;
import com.cn.bean.vo.EM.partRegt.BarkPar;
import com.cn.mapper.dao.db5.EM.partRegt.SendBackDao;
import com.cn.mapper.dao.db5.EM.wo_manage.WOTeamDutyDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@Transactional
@RequestMapping("/WOTeamDuty")
public class WOTeamDutyController {
    private final WOTeamDutyDao woTeamDutyDao;

    @Autowired(required = false)
    public WOTeamDutyController(WOTeamDutyDao woTeamDutyDao) {
        this.woTeamDutyDao = woTeamDutyDao;

    }

    @RequestMapping("/insert")
    @ResponseBody
    public BarkPar insert(@RequestBody JSONObject jsonObject){
        System.out.println("jsonObject:aaaaaaaaaaaaaaa" + jsonObject);


        return woTeamDutyDao.insert(String.valueOf(jsonObject));

    }

    @RequestMapping("/getSing")
    @ResponseBody
    public String getSing(@RequestBody JSONObject jsonObject){
        System.out.println("jsonObject:aaaaaaaaaaaaaaa" + jsonObject);
        String sing = woTeamDutyDao.getSing(String.valueOf(jsonObject));
        System.out.println("aassdddeeessfff"+sing);
        return sing;
    }

    @RequestMapping("/getList")
    @ResponseBody
    public String getList(@RequestBody JSONObject jsonObject)  {
        System.out.println("jsonObject:aaaaaaaaaaaaaaa" + jsonObject);
        String list = woTeamDutyDao.getList(String.valueOf(jsonObject));
        System.out.println("xxxxxxxxxxxxxx:"+list);
        return list;
    }
    @RequestMapping("/getRack")
    @ResponseBody
    public String getRack(@RequestBody JSONObject jsonObject)  {
        System.out.println("jsonObject:eeeeeeee" + jsonObject);
        String list = woTeamDutyDao.getRack(String.valueOf(jsonObject));
        System.out.println("xxxxxxxxaaxxxxxx:"+list);
        return list;
    }
    @RequestMapping("/getInfo")
    @ResponseBody
    public String getInfo(@RequestBody JSONObject jsonObject)  {
        System.out.println("jsonObject:ccccccccccc" + jsonObject);
        String list = woTeamDutyDao.getInfo(String.valueOf(jsonObject));
        System.out.println("assxxxxxxxxxx:"+list);
        return list;
    }
    @RequestMapping("/stateUp")
    @ResponseBody
    public BarkPar stateUp(@RequestBody JSONObject jsonObject)  {
        System.out.println("jsonObject:ccccccccccc" + jsonObject);

        return woTeamDutyDao.stateUp(String.valueOf(jsonObject));
    }
    @RequestMapping("/getTeamPerson")
    @ResponseBody
    public String getTeamPerson(@RequestBody JSONObject jsonObject) {
        System.out.println("ccccccccc:" + jsonObject);
//        woPlanDao.getPars(String.valueOf(jsonObject));
        return woTeamDutyDao.getTeamPerson(String.valueOf(jsonObject));

    }
    @RequestMapping("/getTeamPersons")
    @ResponseBody
    public String getTeamPersons(@RequestBody JSONObject jsonObject) {
        System.out.println("ccccccccc:" + jsonObject);
        return woTeamDutyDao.getTeamPersons(String.valueOf(jsonObject));

    }
    @RequestMapping("/EquCheck")
    @ResponseBody
    public BarkPar EquCheck(@RequestBody JSONObject jsonObject) {
        System.out.println("ccccccccc:" + jsonObject);
        return woTeamDutyDao.EquCheck(String.valueOf(jsonObject));

    }
}
